package com.woniuxy.carType.controller;

import com.woniuxy.carType.model.entity.CarType;
import com.woniuxy.carType.service.CarTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/carType")
public class carTypeController {
    @Autowired
    private CarTypeService carTypeService;

    @GetMapping("/findAll")
    public ResponseEntity<List<CarType>> findAll(){
        List<CarType> types= carTypeService.findAll();
        return ResponseEntity.ok(types);
    }
}
